Plane: update throttle mix uses filtered accelerations #13723
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is the QuadPlane equivalent of this multicopter PR:#13639 which aims to improve landing detection by placing a 1hz filter on the accelerations used in the update_throttle_mix function. The update_throttle_mix feature's output is one of the inputs to the landing detector (see QuadPlane::should_relax()'s call to attitude_control->is_throttle_mix_min()).
@lthall is really the expert in this area but the purpose of the "throttle_mix" feature is to decide on the priority of attitude control vs altitude control. A example of when these two controllers conflict with each other is during a fast descent (or more accurately a fast vertical deceleration). The altitude controllers will want to pull the overall throttle low to descend while the attitude controllers will want to raise the overall throttle in order to give the rate controllers more "room" (i.e. a larger difference in PWM between opposite motors).
One of the inputs to the throttle_mix feature is the vehicle's acceleration. Master currently uses the instantaneous accelerations while this PR adds a 1hz filter instead (consistent with Copter).
This has been lightly tested in SITL with multiple landings using various accelerations (I set SIM_ACC_RND to 0, 3, 5, 10, 15, 20 and even really large values). Sadly this testing didn't expose any existing issues with QuadPlane's landing detection meaning I couldn't see any improvement by applying this PR.
In multicopter's this is the kind of accelerations we can see on large vehicles during touch down. This is the situation where we think this type of filtering should help (actual flight testing should happen in the coming few days).
![image](https://user-images.githubusercontent.com/1498098/75851989-5709fb80-5e2e-11ea-9a82-e80dc2cb1923.png)
This PR closes this issue: #13664